package com.bumptech.glide.load.model;

import android.os.ParcelFileDescriptor;
import com.bumptech.glide.load.data.DataFetcher;
import java.io.InputStream;

public class ImageVideoModelLoader<A>
  implements ModelLoader<A, ImageVideoWrapper>
{
  private static final String TAG = "IVML";
  private final ModelLoader<A, ParcelFileDescriptor> fileDescriptorLoader;
  private final ModelLoader<A, InputStream> streamLoader;

  public ImageVideoModelLoader(ModelLoader<A, InputStream> paramModelLoader, ModelLoader<A, ParcelFileDescriptor> paramModelLoader1)
  {
    if ((paramModelLoader == null) && (paramModelLoader1 == null))
      throw new NullPointerException("At least one of streamLoader and fileDescriptorLoader must be non null");
    this.streamLoader = paramModelLoader;
    this.fileDescriptorLoader = paramModelLoader1;
  }

  public DataFetcher<ImageVideoWrapper> getResourceFetcher(A paramA, int paramInt1, int paramInt2)
  {
    ModelLoader localModelLoader1 = this.streamLoader;
    DataFetcher localDataFetcher1 = null;
    if (localModelLoader1 != null)
      localDataFetcher1 = this.streamLoader.getResourceFetcher(paramA, paramInt1, paramInt2);
    ModelLoader localModelLoader2 = this.fileDescriptorLoader;
    DataFetcher localDataFetcher2 = null;
    if (localModelLoader2 != null)
      localDataFetcher2 = this.fileDescriptorLoader.getResourceFetcher(paramA, paramInt1, paramInt2);
    if ((localDataFetcher1 != null) || (localDataFetcher2 != null))
      return new ImageVideoFetcher(localDataFetcher1, localDataFetcher2);
    return null;
  }

  static class ImageVideoFetcher
    implements DataFetcher<ImageVideoWrapper>
  {
    private final DataFetcher<ParcelFileDescriptor> fileDescriptorFetcher;
    private final DataFetcher<InputStream> streamFetcher;

    public ImageVideoFetcher(DataFetcher<InputStream> paramDataFetcher, DataFetcher<ParcelFileDescriptor> paramDataFetcher1)
    {
      this.streamFetcher = paramDataFetcher;
      this.fileDescriptorFetcher = paramDataFetcher1;
    }

    public void cancel()
    {
      if (this.streamFetcher != null)
        this.streamFetcher.cancel();
      if (this.fileDescriptorFetcher != null)
        this.fileDescriptorFetcher.cancel();
    }

    public void cleanup()
    {
      if (this.streamFetcher != null)
        this.streamFetcher.cleanup();
      if (this.fileDescriptorFetcher != null)
        this.fileDescriptorFetcher.cleanup();
    }

    public String getId()
    {
      if (this.streamFetcher != null)
        return this.streamFetcher.getId();
      return this.fileDescriptorFetcher.getId();
    }

    // ERROR //
    public ImageVideoWrapper loadData(com.bumptech.glide.Priority paramPriority)
      throws java.lang.Exception
    {
      // Byte code:
      //   0: aload_0
      //   1: getfield 19	com/bumptech/glide/load/model/ImageVideoModelLoader$ImageVideoFetcher:streamFetcher	Lcom/bumptech/glide/load/data/DataFetcher;
      //   4: astore_2
      //   5: aconst_null
      //   6: astore_3
      //   7: aload_2
      //   8: ifnull +17 -> 25
      //   11: aload_0
      //   12: getfield 19	com/bumptech/glide/load/model/ImageVideoModelLoader$ImageVideoFetcher:streamFetcher	Lcom/bumptech/glide/load/data/DataFetcher;
      //   15: aload_1
      //   16: invokeinterface 38 2 0
      //   21: checkcast 40	java/io/InputStream
      //   24: astore_3
      //   25: aload_0
      //   26: getfield 21	com/bumptech/glide/load/model/ImageVideoModelLoader$ImageVideoFetcher:fileDescriptorFetcher	Lcom/bumptech/glide/load/data/DataFetcher;
      //   29: astore 4
      //   31: aconst_null
      //   32: astore 5
      //   34: aload 4
      //   36: ifnull +18 -> 54
      //   39: aload_0
      //   40: getfield 21	com/bumptech/glide/load/model/ImageVideoModelLoader$ImageVideoFetcher:fileDescriptorFetcher	Lcom/bumptech/glide/load/data/DataFetcher;
      //   43: aload_1
      //   44: invokeinterface 38 2 0
      //   49: checkcast 42	android/os/ParcelFileDescriptor
      //   52: astore 5
      //   54: new 44	com/bumptech/glide/load/model/ImageVideoWrapper
      //   57: dup
      //   58: aload_3
      //   59: aload 5
      //   61: invokespecial 47	com/bumptech/glide/load/model/ImageVideoWrapper:<init>	(Ljava/io/InputStream;Landroid/os/ParcelFileDescriptor;)V
      //   64: areturn
      //   65: astore 8
      //   67: ldc 49
      //   69: iconst_2
      //   70: invokestatic 55	android/util/Log:isLoggable	(Ljava/lang/String;I)Z
      //   73: ifeq +13 -> 86
      //   76: ldc 49
      //   78: ldc 57
      //   80: aload 8
      //   82: invokestatic 61	android/util/Log:v	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
      //   85: pop
      //   86: aload_0
      //   87: getfield 21	com/bumptech/glide/load/model/ImageVideoModelLoader$ImageVideoFetcher:fileDescriptorFetcher	Lcom/bumptech/glide/load/data/DataFetcher;
      //   90: astore 9
      //   92: aconst_null
      //   93: astore_3
      //   94: aload 9
      //   96: ifnonnull -71 -> 25
      //   99: aload 8
      //   101: athrow
      //   102: astore 6
      //   104: ldc 49
      //   106: iconst_2
      //   107: invokestatic 55	android/util/Log:isLoggable	(Ljava/lang/String;I)Z
      //   110: ifeq +13 -> 123
      //   113: ldc 49
      //   115: ldc 63
      //   117: aload 6
      //   119: invokestatic 61	android/util/Log:v	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
      //   122: pop
      //   123: aconst_null
      //   124: astore 5
      //   126: aload_3
      //   127: ifnonnull -73 -> 54
      //   130: aload 6
      //   132: athrow
      //
      // Exception table:
      //   from	to	target	type
      //   11	25	65	java/lang/Exception
      //   39	54	102	java/lang/Exception
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.bumptech.glide.load.model.ImageVideoModelLoader
 * JD-Core Version:    0.6.2
 */